/*
 * WidgetSonido.cpp
 *
 *  Created on: 20/06/2012
 *      Author: lucho0
 */

#include "WidgetSonido.h"

#define WANT_SOUND_EFFECTS true

WidgetSonido::WidgetSonido(std::string soundPath) {
	if (WANT_SOUND_EFFECTS) this -> effect = Mix_LoadWAV(soundPath.c_str());

}

WidgetSonido::~WidgetSonido() {
	if (WANT_SOUND_EFFECTS) Mix_FreeChunk(effect);
}


void WidgetSonido::playSound(){
	if (WANT_SOUND_EFFECTS) Mix_PlayChannel(-1,effect,0);
}
